Package-level declarations

Types

Link copied to clipboard
object AppDebug
Link copied to clipboard
Link copied to clipboard
class AppFlag(val title: String, val key: String, val description: String, val defaultValue: Boolean)

An individual "feature flag". I recommend creating, in your project-specific code, a kotlin global object that registers all of the known flags for your app:

Link copied to clipboard
abstract class AppFlagsListener(val flagsToMonitor: Set<AppFlag>? = null)

Class that can be extended by code that would like to listen to modifications for a set of specific flags, or all flags. If flagsToMonitor is null then a subclass will be notified of changes to every flag.

Link copied to clipboard
class AppLogger(val id: String, isEnabled: Boolean = false)

A logger logs. That is, it can write text and certain objects to a file or output stream, if it is enabled

Link copied to clipboard
class AppTimer @JvmOverloads constructor(timerName: String = "", val logger: AppLogger = AppDebug.DEBUG)

A timer times. It records a timestamp upon initialisation and then can log messages at subsequent points with the amount of time that has elapsed since the timer was started and since the last log point.

Link copied to clipboard
class CountingSource(source: Source) : ForwardingSource

Replacement to CountingInputStream - a source which counts the number of bytes read from a wrapped source

Link copied to clipboard
class CustomDateFormat(formatStr: String?)

Flexible date parser and formatter

Link copied to clipboard
object DateUtil
Link copied to clipboard
object IOUtils
Link copied to clipboard
object MDFlags
Link copied to clipboard
object Misc

Random useful stuff

Link copied to clipboard
class SearchString(val text: String)

Class to automatically parse a string into search terms, including quoted text, detecting numeric values, etc

Link copied to clipboard
data class SearchStringToken(val string: String, val quoted: Boolean)
Link copied to clipboard
interface StreamObject

Interface for objects that can be read/written to and from streams.

Link copied to clipboard

Subclass of HashMap that can read and write itself to a stream.

Link copied to clipboard
object StreamUtil

Utility functions used to ease the parsing and encoding of StreamObjects

Link copied to clipboard

Subclass of ArrayList that can read and write itself to a stream.

Link copied to clipboard

Exception thrown when a format error is encountered while reading in a StreamObject.

Link copied to clipboard

Properties

Link copied to clipboard

Convenience property that always returns a String (default "") rather than null if the target is null or blank

Link copied to clipboard

Convenience property to return the number of characters after the last '.' in a String

Link copied to clipboard

Convenience property to get the appropriate DecimalFormatSymbols corresponding to a decimal point character (. or ,)

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Useful string manipulation functions

Link copied to clipboard
Link copied to clipboard

Convenience property that returns null if the target (optional) string is either null or blank

Link copied to clipboard
val <T> List<T>?.nullIfEmpty: List<T>?
Link copied to clipboard

If the receiving String is a path, return the parent directory of the file or directory represented by the that. If there is no parent directory of this path, return null. This is the inverse of StringUtils.concatenatePaths.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Method on String to copy that target to the clipboard

Link copied to clipboard
fun CoroutineDispatcher.dispatch(block: Runnable)

Provide an easy way to dispatch tasks to the main thread. For example, to run a block on the main thread without suspending the calling code, use:

Link copied to clipboard
fun main(args: Array<String>)
Link copied to clipboard
fun String.removingSuffixContaining(charactersToRemove: String): String

Return a copy of this string, with any trailing whitespace or characters from the given string removed